{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>任务ID</th>\n",
       "      <th>RFQID</th>\n",
       "      <th>模块</th>\n",
       "      <th>一级</th>\n",
       "      <th>二级</th>\n",
       "      <th>描述</th>\n",
       "      <th>任务名称</th>\n",
       "      <th>工时</th>\n",
       "      <th>任务状态</th>\n",
       "      <th>角色分类</th>\n",
       "      <th>...</th>\n",
       "      <th>删除</th>\n",
       "      <th>删除标识</th>\n",
       "      <th>删除记录</th>\n",
       "      <th>所属项目</th>\n",
       "      <th>三级</th>\n",
       "      <th>优先级</th>\n",
       "      <th>前置依赖</th>\n",
       "      <th>任务描述</th>\n",
       "      <th>备注</th>\n",
       "      <th>提测日期</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>T00066</td>\n",
       "      <td>F0586</td>\n",
       "      <td>数字化车联网</td>\n",
       "      <td>车辆数据分析</td>\n",
       "      <td>驾驶行为分析</td>\n",
       "      <td>NaN</td>\n",
       "      <td>离线数据开发</td>\n",
       "      <td>NaN</td>\n",
       "      <td>已完成</td>\n",
       "      <td>大数据</td>\n",
       "      <td>...</td>\n",
       "      <td>删除</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>数字化平台</td>\n",
       "      <td>NaN</td>\n",
       "      <td>P3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2023/12/26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>T00076</td>\n",
       "      <td>F0586</td>\n",
       "      <td>数字化车联网</td>\n",
       "      <td>车辆数据分析</td>\n",
       "      <td>驾驶行为分析</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>已完成</td>\n",
       "      <td>前端</td>\n",
       "      <td>...</td>\n",
       "      <td>删除</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>数字化平台</td>\n",
       "      <td>NaN</td>\n",
       "      <td>P3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2023/12/26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>T00032</td>\n",
       "      <td>F0586</td>\n",
       "      <td>数字化车联网</td>\n",
       "      <td>车辆数据分析</td>\n",
       "      <td>驾驶行为分析</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>已完成</td>\n",
       "      <td>前端</td>\n",
       "      <td>...</td>\n",
       "      <td>删除</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>数字化平台</td>\n",
       "      <td>NaN</td>\n",
       "      <td>P3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2023/12/26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>T00126</td>\n",
       "      <td>F0586</td>\n",
       "      <td>数字化车联网</td>\n",
       "      <td>车辆数据分析</td>\n",
       "      <td>驾驶行为分析</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>已完成</td>\n",
       "      <td>前端</td>\n",
       "      <td>...</td>\n",
       "      <td>删除</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>数字化平台</td>\n",
       "      <td>NaN</td>\n",
       "      <td>P3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2023/12/26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>T00053</td>\n",
       "      <td>F0586</td>\n",
       "      <td>数字化车联网</td>\n",
       "      <td>车辆数据分析</td>\n",
       "      <td>驾驶行为分析</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>已完成</td>\n",
       "      <td>后端</td>\n",
       "      <td>...</td>\n",
       "      <td>删除</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>数字化平台</td>\n",
       "      <td>NaN</td>\n",
       "      <td>P3</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2023/12/26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>468</th>\n",
       "      <td>T00676</td>\n",
       "      <td>F0870</td>\n",
       "      <td>0430客户反馈的路线变更</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>试驾路线变更，带来的需求调整</td>\n",
       "      <td>需求变更</td>\n",
       "      <td>2.0</td>\n",
       "      <td>已完成</td>\n",
       "      <td>前端</td>\n",
       "      <td>...</td>\n",
       "      <td>删除</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Smart-D</td>\n",
       "      <td>NaN</td>\n",
       "      <td>P2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>469</th>\n",
       "      <td>T00677</td>\n",
       "      <td>F0870</td>\n",
       "      <td>0430客户反馈的路线变更</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>试驾路线变更，带来的需求调整</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.0</td>\n",
       "      <td>已完成</td>\n",
       "      <td>后端</td>\n",
       "      <td>...</td>\n",
       "      <td>删除</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Smart-D</td>\n",
       "      <td>NaN</td>\n",
       "      <td>P2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>470</th>\n",
       "      <td>T00683</td>\n",
       "      <td>F0874</td>\n",
       "      <td>公众号登录，推送试驾报告</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Smart-D Demo ,公众号自动发送报告</td>\n",
       "      <td>修改登录流程</td>\n",
       "      <td>NaN</td>\n",
       "      <td>未开始</td>\n",
       "      <td>安卓</td>\n",
       "      <td>...</td>\n",
       "      <td>删除</td>\n",
       "      <td>已删除</td>\n",
       "      <td>删除时间：2024/05/09 10:23，申请人：蒋伟；</td>\n",
       "      <td>Smart-D</td>\n",
       "      <td>NaN</td>\n",
       "      <td>P2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>471</th>\n",
       "      <td>T00684</td>\n",
       "      <td>F0874</td>\n",
       "      <td>公众号登录，推送试驾报告</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Smart-D Demo ,公众号自动发送报告</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.0</td>\n",
       "      <td>进行中</td>\n",
       "      <td>后端</td>\n",
       "      <td>...</td>\n",
       "      <td>删除</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Smart-D</td>\n",
       "      <td>NaN</td>\n",
       "      <td>P2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>472</th>\n",
       "      <td>T00687</td>\n",
       "      <td>F0874</td>\n",
       "      <td>公众号登录，推送试驾报告</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Smart-D Demo ,公众号自动发送报告</td>\n",
       "      <td>模板开发</td>\n",
       "      <td>NaN</td>\n",
       "      <td>进行中</td>\n",
       "      <td>前端</td>\n",
       "      <td>...</td>\n",
       "      <td>删除</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Smart-D</td>\n",
       "      <td>NaN</td>\n",
       "      <td>P2</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>473 rows × 37 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       任务ID  RFQID             模块      一级      二级                       描述  \\\n",
       "0    T00066  F0586         数字化车联网  车辆数据分析  驾驶行为分析                      NaN   \n",
       "1    T00076  F0586         数字化车联网  车辆数据分析  驾驶行为分析                      NaN   \n",
       "2    T00032  F0586         数字化车联网  车辆数据分析  驾驶行为分析                      NaN   \n",
       "3    T00126  F0586         数字化车联网  车辆数据分析  驾驶行为分析                      NaN   \n",
       "4    T00053  F0586         数字化车联网  车辆数据分析  驾驶行为分析                      NaN   \n",
       "..      ...    ...            ...     ...     ...                      ...   \n",
       "468  T00676  F0870  0430客户反馈的路线变更     NaN     NaN           试驾路线变更，带来的需求调整   \n",
       "469  T00677  F0870  0430客户反馈的路线变更     NaN     NaN           试驾路线变更，带来的需求调整   \n",
       "470  T00683  F0874   公众号登录，推送试驾报告     NaN     NaN  Smart-D Demo ,公众号自动发送报告   \n",
       "471  T00684  F0874   公众号登录，推送试驾报告     NaN     NaN  Smart-D Demo ,公众号自动发送报告   \n",
       "472  T00687  F0874   公众号登录，推送试驾报告     NaN     NaN  Smart-D Demo ,公众号自动发送报告   \n",
       "\n",
       "       任务名称   工时 任务状态 角色分类  ...  删除 删除标识                           删除记录  \\\n",
       "0    离线数据开发  NaN  已完成  大数据  ...  删除  NaN                            NaN   \n",
       "1       NaN  NaN  已完成   前端  ...  删除  NaN                            NaN   \n",
       "2       NaN  NaN  已完成   前端  ...  删除  NaN                            NaN   \n",
       "3       NaN  NaN  已完成   前端  ...  删除  NaN                            NaN   \n",
       "4       NaN  NaN  已完成   后端  ...  删除  NaN                            NaN   \n",
       "..      ...  ...  ...  ...  ...  ..  ...                            ...   \n",
       "468    需求变更  2.0  已完成   前端  ...  删除  NaN                            NaN   \n",
       "469     NaN  2.0  已完成   后端  ...  删除  NaN                            NaN   \n",
       "470  修改登录流程  NaN  未开始   安卓  ...  删除  已删除  删除时间：2024/05/09 10:23，申请人：蒋伟；   \n",
       "471     NaN  4.0  进行中   后端  ...  删除  NaN                            NaN   \n",
       "472    模板开发  NaN  进行中   前端  ...  删除  NaN                            NaN   \n",
       "\n",
       "        所属项目   三级  优先级  前置依赖 任务描述   备注        提测日期  \n",
       "0      数字化平台  NaN   P3   NaN  NaN  NaN  2023/12/26  \n",
       "1      数字化平台  NaN   P3   NaN  NaN  NaN  2023/12/26  \n",
       "2      数字化平台  NaN   P3   NaN  NaN  NaN  2023/12/26  \n",
       "3      数字化平台  NaN   P3   NaN  NaN  NaN  2023/12/26  \n",
       "4      数字化平台  NaN   P3   NaN  NaN  NaN  2023/12/26  \n",
       "..       ...  ...  ...   ...  ...  ...         ...  \n",
       "468  Smart-D  NaN   P2   NaN  NaN  NaN         NaN  \n",
       "469  Smart-D  NaN   P2   NaN  NaN  NaN         NaN  \n",
       "470  Smart-D  NaN   P2   NaN  NaN  NaN         NaN  \n",
       "471  Smart-D  NaN   P2   NaN  NaN  NaN         NaN  \n",
       "472  Smart-D  NaN   P2   NaN  NaN  NaN         NaN  \n",
       "\n",
       "[473 rows x 37 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "path = 'C:/Users/pc/Desktop/Data/【绝密】汽车数字化部目标管理_需求管理表-任务执行表_任务执行表_徐云涛.csv'\n",
    "df = pd.read_csv(path, encoding='utf-8', header=0)\n",
    "\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>所属项目</th>\n",
       "      <th>生产版本</th>\n",
       "      <th>RFQID</th>\n",
       "      <th>任务ID</th>\n",
       "      <th>模块</th>\n",
       "      <th>一级</th>\n",
       "      <th>二级</th>\n",
       "      <th>任务名称</th>\n",
       "      <th>任务状态</th>\n",
       "      <th>工时</th>\n",
       "      <th>指派给</th>\n",
       "      <th>计划开始日期</th>\n",
       "      <th>计划结束日期</th>\n",
       "      <th>描述</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>244</th>\n",
       "      <td>Smart-D</td>\n",
       "      <td>V-0.1.0</td>\n",
       "      <td>F0713</td>\n",
       "      <td>T00279</td>\n",
       "      <td>共通</td>\n",
       "      <td>框架技术选型及文档编写</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>于凯奇</td>\n",
       "      <td>2024/02/26</td>\n",
       "      <td>2024/02/26</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>243</th>\n",
       "      <td>Smart-D</td>\n",
       "      <td>V-0.1.0</td>\n",
       "      <td>F0713</td>\n",
       "      <td>T00278</td>\n",
       "      <td>共通</td>\n",
       "      <td>框架技术选型及文档编写</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>王思涵</td>\n",
       "      <td>2024/02/04</td>\n",
       "      <td>2024/02/05</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>249</th>\n",
       "      <td>Smart-D</td>\n",
       "      <td>V-0.1.0</td>\n",
       "      <td>F0714</td>\n",
       "      <td>T00280</td>\n",
       "      <td>共通</td>\n",
       "      <td>框架搭建及环境准备</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>于凯奇</td>\n",
       "      <td>2024/02/20</td>\n",
       "      <td>2024/03/01</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>245</th>\n",
       "      <td>Smart-D</td>\n",
       "      <td>V-0.1.0</td>\n",
       "      <td>F0714</td>\n",
       "      <td>T00282</td>\n",
       "      <td>共通</td>\n",
       "      <td>框架搭建及环境准备</td>\n",
       "      <td>NaN</td>\n",
       "      <td>地图调研</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>刘喆</td>\n",
       "      <td>2024/02/04</td>\n",
       "      <td>2024/02/07</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>248</th>\n",
       "      <td>Smart-D</td>\n",
       "      <td>V-0.1.0</td>\n",
       "      <td>F0714</td>\n",
       "      <td>T00292</td>\n",
       "      <td>共通</td>\n",
       "      <td>框架搭建及环境准备</td>\n",
       "      <td>NaN</td>\n",
       "      <td>安卓框架学习</td>\n",
       "      <td>1</td>\n",
       "      <td>NaN</td>\n",
       "      <td>刘喆</td>\n",
       "      <td>2024/02/19</td>\n",
       "      <td>2024/03/01</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>201</th>\n",
       "      <td>灵镜</td>\n",
       "      <td>release-2.4.6</td>\n",
       "      <td>F0676</td>\n",
       "      <td>T00634</td>\n",
       "      <td>灵镜</td>\n",
       "      <td>洞察对比</td>\n",
       "      <td>第五版</td>\n",
       "      <td>功能开发 联调</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>刘鑫添</td>\n",
       "      <td>2024/04/24</td>\n",
       "      <td>2024/04/25</td>\n",
       "      <td>1.我的洞察：\\n（1）我的洞察增加勾选多个洞察进行对比；我的洞察中增加多个洞察进行对比\\n...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>203</th>\n",
       "      <td>灵镜</td>\n",
       "      <td>release-2.4.6</td>\n",
       "      <td>F0676</td>\n",
       "      <td>T00643</td>\n",
       "      <td>灵镜</td>\n",
       "      <td>洞察对比</td>\n",
       "      <td>第五版</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>4.5</td>\n",
       "      <td>张书译</td>\n",
       "      <td>2024/05/20</td>\n",
       "      <td>2024/05/24</td>\n",
       "      <td>1.我的洞察：\\n（1）我的洞察增加勾选多个洞察进行对比；我的洞察中增加多个洞察进行对比\\n...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>204</th>\n",
       "      <td>灵镜</td>\n",
       "      <td>release-2.4.6</td>\n",
       "      <td>F0677</td>\n",
       "      <td>T00654</td>\n",
       "      <td>灵镜</td>\n",
       "      <td>我的洞察</td>\n",
       "      <td>第六版</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>于凯奇</td>\n",
       "      <td>2024/04/29</td>\n",
       "      <td>2024/04/30</td>\n",
       "      <td>1.我的洞察：\\n（1）新建洞察增加类型筛选：手动编辑&amp;用户组筛选\\n（2）洞察详情页用户组...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>206</th>\n",
       "      <td>灵镜</td>\n",
       "      <td>release-2.4.6</td>\n",
       "      <td>F0677</td>\n",
       "      <td>T00656</td>\n",
       "      <td>灵镜</td>\n",
       "      <td>我的洞察</td>\n",
       "      <td>第六版</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1</td>\n",
       "      <td>2.0</td>\n",
       "      <td>刘鑫添</td>\n",
       "      <td>2024/04/29</td>\n",
       "      <td>2024/05/07</td>\n",
       "      <td>1.我的洞察：\\n（1）新建洞察增加类型筛选：手动编辑&amp;用户组筛选\\n（2）洞察详情页用户组...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>205</th>\n",
       "      <td>灵镜</td>\n",
       "      <td>release-2.4.6</td>\n",
       "      <td>F0677</td>\n",
       "      <td>T00655</td>\n",
       "      <td>灵镜</td>\n",
       "      <td>我的洞察</td>\n",
       "      <td>第六版</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>汪文博</td>\n",
       "      <td>2024/05/14</td>\n",
       "      <td>2024/05/24</td>\n",
       "      <td>1.我的洞察：\\n（1）新建洞察增加类型筛选：手动编辑&amp;用户组筛选\\n（2）洞察详情页用户组...</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>86 rows × 14 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "        所属项目           生产版本  RFQID    任务ID  模块           一级   二级     任务名称  \\\n",
       "244  Smart-D        V-0.1.0  F0713  T00279  共通  框架技术选型及文档编写  NaN      NaN   \n",
       "243  Smart-D        V-0.1.0  F0713  T00278  共通  框架技术选型及文档编写  NaN      NaN   \n",
       "249  Smart-D        V-0.1.0  F0714  T00280  共通    框架搭建及环境准备  NaN      NaN   \n",
       "245  Smart-D        V-0.1.0  F0714  T00282  共通    框架搭建及环境准备  NaN     地图调研   \n",
       "248  Smart-D        V-0.1.0  F0714  T00292  共通    框架搭建及环境准备  NaN   安卓框架学习   \n",
       "..       ...            ...    ...     ...  ..          ...  ...      ...   \n",
       "201       灵镜  release-2.4.6  F0676  T00634  灵镜         洞察对比  第五版  功能开发 联调   \n",
       "203       灵镜  release-2.4.6  F0676  T00643  灵镜         洞察对比  第五版      NaN   \n",
       "204       灵镜  release-2.4.6  F0677  T00654  灵镜         我的洞察  第六版      NaN   \n",
       "206       灵镜  release-2.4.6  F0677  T00656  灵镜         我的洞察  第六版      NaN   \n",
       "205       灵镜  release-2.4.6  F0677  T00655  灵镜         我的洞察  第六版      NaN   \n",
       "\n",
       "    任务状态   工时  指派给      计划开始日期      计划结束日期  \\\n",
       "244    1  NaN  于凯奇  2024/02/26  2024/02/26   \n",
       "243    1  NaN  王思涵  2024/02/04  2024/02/05   \n",
       "249    1  NaN  于凯奇  2024/02/20  2024/03/01   \n",
       "245    1  NaN   刘喆  2024/02/04  2024/02/07   \n",
       "248    1  NaN   刘喆  2024/02/19  2024/03/01   \n",
       "..   ...  ...  ...         ...         ...   \n",
       "201    1  2.0  刘鑫添  2024/04/24  2024/04/25   \n",
       "203    0  4.5  张书译  2024/05/20  2024/05/24   \n",
       "204    1  2.0  于凯奇  2024/04/29  2024/04/30   \n",
       "206    1  2.0  刘鑫添  2024/04/29  2024/05/07   \n",
       "205    0  3.0  汪文博  2024/05/14  2024/05/24   \n",
       "\n",
       "                                                    描述  \n",
       "244                                                NaN  \n",
       "243                                                NaN  \n",
       "249                                                NaN  \n",
       "245                                                NaN  \n",
       "248                                                NaN  \n",
       "..                                                 ...  \n",
       "201  1.我的洞察：\\n（1）我的洞察增加勾选多个洞察进行对比；我的洞察中增加多个洞察进行对比\\n...  \n",
       "203  1.我的洞察：\\n（1）我的洞察增加勾选多个洞察进行对比；我的洞察中增加多个洞察进行对比\\n...  \n",
       "204  1.我的洞察：\\n（1）新建洞察增加类型筛选：手动编辑&用户组筛选\\n（2）洞察详情页用户组...  \n",
       "206  1.我的洞察：\\n（1）新建洞察增加类型筛选：手动编辑&用户组筛选\\n（2）洞察详情页用户组...  \n",
       "205  1.我的洞察：\\n（1）新建洞察增加类型筛选：手动编辑&用户组筛选\\n（2）洞察详情页用户组...  \n",
       "\n",
       "[86 rows x 14 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 将“任务状态”列的内容，将“取消”的数据过滤掉\n",
    "df = df[df[\"任务状态\"] != \"取消\"]\n",
    "\n",
    "# 将“需求状态”列的内容，同时将“已上线”和“取消”两种状态的数据全部过滤掉\n",
    "df = df[(df[\"需求状态\"] != \"已上线\") & (df[\"需求状态\"] != \"取消\")]\n",
    "\n",
    "# df1数据集只保留部分内容用于分析\n",
    "df_filter = df[[\"所属项目\",\"生产版本\",\"RFQID\",\"任务ID\",\"模块\",\"一级\",\"二级\",\"任务名称\",\"任务状态\",\"工时\",\"指派给\",\"计划开始日期\",\"计划结束日期\",\"描述\"]]\n",
    "\n",
    "# 如果“任务状态”列的内容为已完成，则转换成100%，否则转换成0%\n",
    "mask = df_filter[\"任务状态\"] == \"已完成\"\n",
    "df_filter.loc[mask, \"任务状态\"] = 1\n",
    "df_filter.loc[~mask, \"任务状态\"] = 0\n",
    "\n",
    "# 按照某些字段进行排序\n",
    "df_sort = df_filter.sort_values(by=['所属项目','生产版本','RFQID','指派给','计划开始日期'])\n",
    "\n",
    "# # 将时间列由yyyy/mm/dd格式转换成yyyy-mm-dd格式\n",
    "# df_sort[\"计划开始日期\"] = pd.to_datetime(df_sort[\"计划开始日期\"])\n",
    "# df_sort[\"计划结束日期\"] = pd.to_datetime(df_sort[\"计划结束日期\"])\n",
    "# df_sort.info()\n",
    "\n",
    "# df_sort[\"计划开始日期\"] = df_sort[\"计划开始日期\"].apply(lambda x: x.strftime('%Y-%m-%d'))\n",
    "\n",
    "df_sort"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def workDayNew(projectName,df_sort):\n",
    "    # 定义列名\n",
    "    column = ['任务ID', '模块','一级','二级','任务名称','任务状态','工时', '指派给', '计划开始日期', '计划结束日期','描述']\n",
    "    df_result = pd.DataFrame(columns=column)\n",
    "    df_grouped = df_sort[df_sort['所属项目']==projectName].groupby(['RFQID'])\n",
    "\n",
    "    for name,group in df_grouped:\n",
    "        print(name)\n",
    "        print(group)\n",
    "\n",
    "def workDay(projectName,df_sort):\n",
    "    # 定义列名\n",
    "    column = ['任务ID', '模块','一级','二级','任务名称', '任务状态','工时', '指派给', '计划开始日期', '计划结束日期','描述']\n",
    "    df_result = pd.DataFrame(columns=column)\n",
    "    df_grouped = df_sort[df_sort['所属项目']==projectName].groupby(['RFQID'])\n",
    "\n",
    "    for name,group in df_grouped:\n",
    "        data = [\n",
    "            [name[0],'','','','','','','','','','']\n",
    "        ]\n",
    "        temp_df = pd.DataFrame(data,columns=column)\n",
    "        temp_df = pd.concat([temp_df,group.iloc[:,2:]])\n",
    "\n",
    "        df_result = pd.concat([df_result,temp_df])\n",
    "\n",
    "    df_result.to_excel('E:/工作文件/运营管理部 项目指标/需求表/' + str(projectName) + \" 任务执行表.xlsx\")\n",
    "\n",
    "\n",
    "def getProjectList(df_sort):\n",
    "    unique_project_list = df_sort.drop_duplicates(subset='所属项目')['所属项目'].to_list()\n",
    "    for project in unique_project_list:\n",
    "        # 如果project的内容为空，就跳过\n",
    "        if str(project).lower() == 'nan':\n",
    "            continue\n",
    "        workDay(project,df_sort)\n",
    "\n",
    "getProjectList(df_sort)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
